package com.design.FactoryVSStrategy.strategy;

/** 策略模式上下文
 * @author liangxin
 * @since 27/06/2019
 */
public class ContextFactory {
    private Strategy strategy;
    public ContextFactory(Strategy strategy) {
        this.strategy = strategy;
    }
    public int calculate(int x, int y) {
        return strategy.method(x, y);
    }
}
